import eventlet

eventlet.monkey_patch()
import eventlet.wsgi
import sys

# 获取命令行参数，目的是想让im服务运行的端口在启动程序时指定
if len(sys.argv) < 2:
    print('Usage: python main.py [port]')
    exit(1)

port = int(sys.argv[1])

from server import app
# import notify
import chat

# socketio服务器运行的地址
SERVER_ADDRESS = ('', port)

# 启动socketio服务器
sock = eventlet.listen(SERVER_ADDRESS)
eventlet.wsgi.server(sock, app)
